<template>
  <view id="comment">
    
      <view v-if="list&&list.length>0">
        <view class="comment-list" v-for="(item,index) in list" :key="index">
            <view class="userImg">
                
                <img :src="item.headimg_url" alt="头像" v-if="item.headimg_url">
                <img src="static/img/defaultUser.png" alt="头像" v-else>
            </view>
            <view class="comment-right">
                <view class="conts">

                    <view class="conts-left">
                        <view class="nameUser">{{item.nickname}}</view>
                        <uni-rate :disabled="true" :value="item.serve_scour" :size="14" />
                    </view>
                    <view class="conts-right">{{item.time}}</view>
                </view>

                <view class="conts-detail">
                {{item.content}}
                </view>
            </view>
        </view>
      </view>
      <view v-else style="text-align:center">
          <img src="/static/img/nopingjia.png" alt="暂无评价" style="width:100%">
          <text style="color:#929292;font-size:30rpx">暂无评价，赶紧留下您的金句吧~</text>
      </view>
  </view>
</template>

<script>
import uniRate from '@/components/uni-rate/uni-rate.vue'
export default {
    components:{
        uniRate
    },
    props:{
        list:{
            type:Array
        }
    }
}
</script>

<style lang="scss" scoped>
#comment{
    .comment-list{
        
    
    padding: 20rpx;
    box-sizing: border-box;
    background: #fff;
    display: flex;
    justify-content: space-between;
    .userImg{
        width: 60rpx;
        height: 60rpx;
        border-radius: 50%;
        img{
            width: 100%;
            height: 100%;
        }
    }
    .comment-right{
        width: 100%;
        box-sizing: border-box;
        border-bottom: 1px solid #f7f7f7;;
        .conts{
            display: flex;
            justify-content: space-between;
            width: 100%;
            font-size: 28rpx;
            box-sizing: border-box;
            padding-left: 20rpx;
            .conts-left{
                .nameUser{
                    font-weight: bold;
                    //line-height: 50rpx;
                    margin-bottom: 10rpx;
                }
            }
            .conts-right{
                color: #ccc;
            }
        }
        .conts-detail{
            font-size: 28rpx;
            padding: 20rpx;
        }


    }
}

}
</style>